<template>
  <t-config-provider :global-config="globalConfig">
    <router-view />
  </t-config-provider>
</template>
<script setup>
import merge from 'lodash/merge'
// import enConfig from 'tdesign-vue-next/es/locale/en_US'
import zhConfig from 'tdesign-vue-next/es/locale/zh_CN'
import { watch } from 'vue'
import { useSystem } from './store/system'
const globalConfig = merge(zhConfig, {
  calendar: {},
  table: {},
  pagination: {}
})
const system = useSystem()
watch(
  () => system.token,
  (v) => {
    if (v) {
      system.getUserInfo()
      system.getRouters()
    } else {
      system.setUserInfo(null)
      system.setRouters(null)
    }
  },
  {
    immediate: true
  }
)
</script>
<style scoped></style>
